﻿using System;
using System.Collections.Generic;

namespace PotatoSoft
{
    namespace VOCTS
    {
        namespace Workbench
        {
            public class Examination
            {
                public Int32 ExaminationID { get; set; }
                public string ExaminationName { get; set; }
                public ICollection<WorkbenchImage> ExaminationImages { get; set; }

                //FKs and Reference properties/value objects
                public int ProjectID { get; set; }
                private Project _project;
                public Project Project
                {
                    get { return _project; }
                    set
                    {
                        _project = value;
                        //explicit relationship fixup
                        _project.AddExamination(this);
                    }

                }

                public void AddImage(WorkbenchImage im)
                {
                    if (ExaminationImages == null)
                    {
                        ExaminationImages = new List<WorkbenchImage>();
                    }

                    if (!ExaminationImages.Contains(im))
                    {
                        ExaminationImages.Add(im);
                    }
                    if (im.Examination != this)
                    {
                        im.Examination = this;
                    }
                }
            }
        }
    }
}
